

import request from '@/utils/http/index';


import { NodeParams } from './model/nodeModel';



/**
 * api地址
 */
enum Api {
  NodeImport = '/node/import',
  NodeTree = '/node/tree',
  NodeList = '/node/list',
  NodeCreate = '/node/create',
  NodeUpdate = '/node/update',
  NodeDelete = '/node/delete',
}


export const importFile = (data: any) => {
  return request.upload({ url: Api.NodeImport, data })
}

export const getNodeTree = (data: any) => {
  return request.post({ url: Api.NodeTree, data })
}

export const getNodeList = (data: NodeParams) => {
  return request.post({ url: Api.NodeList,data })
}

// 新增知识库
export const createNode = (data: any) => {
  return request.post({ url: Api.NodeCreate, data })
}

// 修改知识库
export const updateNode = (data: NodeParams) => {
  return request.post({ url: Api.NodeUpdate, data })
}

// 删除知识库
export const deleteNode = (data: NodeParams) => {
  return request.post({ url: Api.NodeDelete, data })
}